package com.xzk.ExpressInnWeb.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class User {

    private int id;
    private String username;
    private String personalid;
    private String userphone;
    private String password;
    private Timestamp createtime;
    private Timestamp logintime;

    public User() {
    }

    public User(String username, String personalid, String userphone, String password) {
        this.username = username;
        this.personalid = personalid;
        this.userphone = userphone;
        this.password = password;
    }

    public User(int id, String username, String personalid, String userphone, String password, Timestamp createtime, Timestamp logintime) {
        this.id = id;
        this.username = username;
        this.personalid = personalid;
        this.userphone = userphone;
        this.password = password;
        this.createtime = createtime;
        this.logintime = logintime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPersonalid() {
        return personalid;
    }

    public void setPersonalid(String personalid) {
        this.personalid = personalid;
    }

    public String getUserphone() {
        return userphone;
    }

    public void setUserphone(String userphone) {
        this.userphone = userphone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    public Timestamp getLogintime() {
        return logintime;
    }

    public void setLogintime(Timestamp logintime) {
        this.logintime = logintime;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", personalid='" + personalid + '\'' +
                ", userphone='" + userphone + '\'' +
                ", password='" + password + '\'' +
                ", createtime=" + createtime +
                ", logintime=" + logintime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id && Objects.equals(username, user.username) && Objects.equals(personalid, user.personalid) && Objects.equals(userphone, user.userphone) && Objects.equals(password, user.password) && Objects.equals(createtime, user.createtime) && Objects.equals(logintime, user.logintime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, personalid, userphone, password, createtime, logintime);
    }
}
